import { Component, OnInit, Input } from '@angular/core';
import { ModalController, AlertController, LoadingController } from "@ionic/angular";
import { AppGlobalService } from 'src/app/shared/service/app-global.service';

declare let $: any
@Component({
  selector: 'app-my-bicon-modal',
  templateUrl: './my-bicon-modal.component.html',
  styleUrls: ['./my-bicon-modal.component.scss'],
})
export class MyBiconModalComponent implements OnInit {
  @Input() tagData: any;
  listData: any;
  constructor(
    private appGlobalService: AppGlobalService,
    public modalController: ModalController) { }

  ngOnInit() {
    this.listData = this.tagData;
    $("#mybicon-modal-box").fadeIn(250);
  }
  // 传值
  go(e, link) {
    try {
      e.stopPropagation();
      this.modalController.dismiss({ dismissed: true });
      const tmpSessionId = localStorage.getItem('sessionId');
      const pageParams = {
        pageId: link.target,
        params: link.params,
        sessionId: tmpSessionId
      };
      this.appGlobalService.goToForward(pageParams);
    } catch (error) {
      console.log('error----->' + JSON.stringify(e));
    }


  }
  close(e) {
    $("#mybicon-modal-box").fadeOut(250);
    setTimeout(() => {
      this.modalController.dismiss();
    }, 250);
  }
}
